<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数据集成平台</title>
    {% load static %}
    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
    <script src="/static/bootstrap/js/jquery.min.js"></script>
    <script src="/static/bootstrap/js/bootstrap.min.js"></script>
    <!-- bootstrap-table -->
    <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.css">
    <script src="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.js"></script>

    <!--<script src="/bootstrap-table/dist/bootstrap-table.js"></script>-->
    <!--<script src="/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>-->
    <style type="text/css">
.div1{
    height:30px;
    margin-bottom:30px;
    margin-left:40px;
    }
.div2{
    margin-left:40px;
    }
table.dataintable {
   margin-top:15px;
   border-collapse:collapse;
   border:1px solid #aaa;
   width:100%;
}
table.dataintable th {
   vertical-align:baseline;
   padding:5px 15px 5px 6px;
   background-color:#B0C4DE;
   border:1px solid #3F3F3F;
   text-align:left;
   color:#fff;
}
table.dataintable td {
   vertical-align:text-top;
   padding:6px 15px 6px 6px;
   border:1px solid #aaa;
}
table.dataintable tr:nth-child(odd) {
   background-color:#F5F5F5;
}
table.dataintable tr:nth-child(even) {
   background-color:#fff;
}

</style>
</head>
<body>

<!-- 导航栏 -->
<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#"></a>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li><a href="/home" ><img src="/static/image/logofina.png" alt="" class="img1" height="40" width="100" /></a></li>
                <li><a href="/home" style="font-size:20px">首页</a></li>
<!--                <li ><a href="/home">首页</a></li>-->
<!--                <li><a  onclick="getData('select_pcqs')">破产清算</a></li>-->
                <li><a  onclick="getData('select_pcqs')"></a></li>
                <li><a  onclick="getData('select_zdccss')"></a></li>
                <li><a  onclick="getData('select_zddwpf')"></a></li>
                <li><a  onclick="getData('select_zccz')"></a></li>
                <li><a  onclick="getData('select_zwwy')"></a></li>
                <li><a  onclick="getData('select_sxcx')"></a></li>
                <li><a  onclick="getData('select_sxffjz')"></a></li>

                <li><a  onclick="getData('select_gqzr')"></a></li>

                <li><a  onclick="getData('select_gqzy')"></a></li>

                <li><a  onclick="getData('select_gdzc')"></a></li>
                <li><a  onclick="getData('select_gdjc')"></a></li>
                <li><a  onclick="getData('select_gqdj')"></a></li>

                <li><a  onclick="getData('select_totaltable')"></a></li>


<!--                <li><a  onclick="getData('select_readjson')">读取事件抽取数据进入DB</a></li>-->
<!--                <li><a  onclick="getData('select_readjson1')">使用DB中的数据执行实体链接</a></li>-->
<!--                <li class="active"><a href="totaljson">读取json</a></li>-->

            </ul>

            </div>
        </div>
</nav>
<div class="div1">
            <ul class="nav navbar-nav">
<!--                <li ><a href="/home">首页</a></li>-->
<!--                <li><a  onclick="getData('select_pcqs')">破产清算</a></li>-->
                <li><a  onclick="getData('select_pcqs')">破产清算</a></li>
                <li><a  onclick="getData('select_zdccss')">重大资产损失</a></li>
                <li><a  onclick="getData('select_zddwpf')">重大对外赔付</a></li>
                <li><a  onclick="getData('select_zccz')">资产重组</a></li>
                <li><a  onclick="getData('select_zwwy')">债务违约</a></li>
                <li><a  onclick="getData('select_sxcx')">涉嫌传销</a></li>
                <li><a  onclick="getData('select_sxffjz')">涉嫌非法集资</a></li>

                <li><a  onclick="getData('select_gqzr')">股权转让</a></li>

                <li><a  onclick="getData('select_gqzy')">股权质押</a></li>

                <li><a  onclick="getData('select_gdzc')">股东增持</a></li>
                <li><a  onclick="getData('select_gdjc')">股东减持</a></li>
                <li><a  onclick="getData('select_gqdj')">股权冻结</a></li>

                <li><a  onclick="getData('select_totaltable')">总表</a></li>


<!--                <li><a  onclick="getData('select_readjson')">读取事件抽取数据进入DB</a></li>-->
<!--                <li><a  onclick="getData('select_readjson1')">使用DB中的数据执行实体链接</a></li>-->
<!--                <li class="active"><a href="totaljson">读取json</a></li>-->
            </ul>
</div>
<!--        <div class="navbar-right">-->
<!--            <ul class="nav navbar-nav">-->
<!--                <li><a href="#">当前班主任：</a></li>-->
<!--                <li><a href="#">{{request.session.name}}</a></li>-->
<!--                <li><a href="/home/outlogin">注销</a></li>-->
<!--            </ul>-->
<!--        </div>-->
<!--主要内容 -->
<div class="panel panel-info">
        <div class="panel-heading">
                    <h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识库中已存在的12类事件表展示</h3>
        <form action="entitylink1" method="post" class="form-horizontal" role="form">
    {% csrf_token %}
<!--<hr />-->
<div class="form-group">
    <input type="submit" class="col-sm-offset-5 col-md-2 btn btn-info" style="font-size:40px" value="执行实体消歧/链接" >
</div>
    </form>
        <div id = "tableInfo" class="panel-title text-center">
<!--            <h3>请选择事件抽取源文件</h3>-->
{% csrf_token %}
            <form enctype="multipart/form-data" action="uploadFile" method="post">
                {% csrf_token %}
<!--                                       <input type="file" name="myfile" id="avatar_file" />-->
<!--                                       <br/>-->
<!--                                       <input type="submit" value="upload">-->
                                    </form>
        </div>
    </div>
    <div class="panel-body">

        <table id="table" class="dataintable"></table>
<!--        <table id="tr" width="150px" class="table table-bordered table-hover text-center">-->
<!--            <tr class="">-->
<!--                <th>学号</th>-->
<!--                <th>学生姓名</th>-->
<!--                <th>年龄</th>-->
<!--                <th>性别</th>-->
<!--                <th>班级</th>-->
<!--                <th>操作</th>-->
<!--            </tr>-->
<!--        </table>-->
    </div>


<!--    <div class="panel-footer text-right">-->
<!--        版权所有&copy;踏雪无痕-->
<!--    </div>-->
</div>
</body>

<script>
    getData('select_pcqs')



<!--处理刷新后不在同一表格问题-->
var  TABLE_NAME = ''

<!--init()-->

<!--function  init(){-->
<!--&lt;!&ndash;初次进入&ndash;&gt;-->
<!--  if(TABLE_NAME == ''){-->
<!--    getData('select_pcqs')-->
<!--  }else{-->
<!--    getData(TABLE_NAME)-->
<!--  }-->

<!--}-->
function myFunction(){
	var x;
	var r=confirm("你确定删除吗？");
	if (r==true){
		return true;
	}
	else{
		return false;
	}
}

function getData(method){
   TABLE_NAME = method
   path = method
   processInfo(method)
 $.ajax({
            url:"/home/" + path ,
            type:"GET",
            {#发送json数据到服务器#}
            dataType :"json",
            {#请求成功回调函数#}
            success:function (data) {
                var html = '';
                mycolumn = []
                console.log(data)
    <!--                获取列名-->
                for(var key in data[0]){
                    var v = {}
                    v['field'] = key
                    v['title'] = key
                    mycolumn.push(v)
                }

<!--          表格赋值（初始化）      -->
                 $('#table').bootstrapTable('destroy')
 $('#table').bootstrapTable('refresh')
                $('#table').bootstrapTable({
                    data:data,
                    columns: mycolumn
                });
<!--                 $('#table').bootstrapTable('refresh')-->

            },
            {#请求失败回调函数#}
            error:function () {
                alert("查询失败")
            }
        });

}


function processInfo(method){

if(method == "select_pcqs"){
  document.getElementById("tableInfo").innerHTML = "实体链接-破产清算结果显示表";
}
else if(method == "select_zdccss"){
  document.getElementById("tableInfo").innerHTML = "实体链接-重大财产损失结果显示表";
}
else if(method == "select_totaltable"){
  document.getElementById("tableInfo").innerHTML = "实体链接-总显示表";
}
else if(method == "select_zddwpf"){
  document.getElementById("tableInfo").innerHTML = "实体链接-重大对外赔付结果显示表";
}
else if(method == "select_zccz"){
  document.getElementById("tableInfo").innerHTML = "实体链接-资产重组结果显示表";
}
else if(method == "select_zwwy"){
  document.getElementById("tableInfo").innerHTML = "实体链接-债务违约结果显示表";
}
else if(method == "select_sxcx"){
  document.getElementById("tableInfo").innerHTML = "实体链接-涉嫌传销结果显示表";
}
else if(method == "select_sxffjz"){
  document.getElementById("tableInfo").innerHTML = "实体链接-涉嫌非法集资结果显示表";
}
else if(method == "select_gqzr"){
  document.getElementById("tableInfo").innerHTML = "实体链接-股权转让-股权受让结果显示表";
}
else if(method == "select_gqzy"){
  document.getElementById("tableInfo").innerHTML = "实体链接-股权质押结果显示表";
}
else if(method == "select_gdzc"){
  document.getElementById("tableInfo").innerHTML = "实体链接-股东增持结果显示表";
}
else if(method == "select_gdjc"){
  document.getElementById("tableInfo").innerHTML = "实体链接-股东减持结果显示表";
}
else if(method == "select_gqdj"){
  document.getElementById("tableInfo").innerHTML = "实体链接-股权冻结结果显示表";
}
else if(method == "select_readjson"){
  document.getElementById("tableInfo").innerHTML = "执行完毕";
}
else if(method == "select_readjson1"){
  document.getElementById("tableInfo").innerHTML = "执行完毕";
}
}




<!--    $.ajax({-->
<!--            url:"/home/select_pcqs",-->
<!--            type:"GET",-->
<!--            {#发送json数据到服务器#}-->
<!--&lt;!&ndash;            dataType :"TEXT",&ndash;&gt;-->
<!--            dataType :"json",-->
<!--            {#请求成功回调函数#}-->
<!--            success:function (data) {-->
<!--&lt;!&ndash;                console.log(data)&ndash;&gt;-->
<!--&lt;!&ndash;                 console.log(typeof(data))&ndash;&gt;-->
<!--                var html = '';-->
<!--                mycolumn = []-->
<!--    &lt;!&ndash;                获取列名&ndash;&gt;-->
<!--                for(var key in data[0]){-->

<!--                    var v = {}-->
<!--                    v['field'] = key-->
<!--                    v['title'] = key-->
<!--                    mycolumn.push(v)-->
<!--                }-->

<!--&lt;!&ndash;                &ndash;&gt;-->
<!--                $('#table').bootstrapTable({-->
<!--                    data:data,-->
<!--                    columns: mycolumn-->
<!--                });-->

<!--            },-->
<!--            {#请求失败回调函数#}-->
<!--            error:function () {-->
<!--                alert("查询失败")-->
<!--            }-->
<!--        });-->

</script>

</html>
